<template>
  <div id="cc">

    <el-row style="margin: 10px;">
      <a class="el-icon-arrow-left" style="float:inherit;margin-top: 2px;padding-top: 7px;" size="small"  @click="back_click()">返回 跑到一 / 2018-5-2 </a>
      <!--<el-button type="primary" icon="el-icon-arrow-left" size="medium" round>主要按钮</el-button>-->
      <el-button type="primary" icon="el-icon-setting" style="float:right" size="small" @click="open">订阅设置</el-button>
      <mu-dialog :open="dialog" title="告警信息订阅设置" @close="close">
        <el-tree
          :data="data2"
          show-checkbox
          node-key="id"
          :default-expanded-keys="[2, 3]"
          :default-checked-keys="[5]"
          :props="defaultProps">
        </el-tree>
        <mu-flat-button slot="actions" @click="close" primary  label="取消"/>
        <mu-flat-button slot="actions" primary @click="close" label="确定"/>
      </mu-dialog>
    </el-row>
    <mu-divider/>
    <el-row style="margin: 10px;">
      <el-table
        :data="tableData3"
        border
        style="width: 100%">
        <el-table-column
          prop="date"
          label="告警IP"
          width="180">
        </el-table-column>
        <el-table-column
          prop="name"
          label="告警内容"
          width="180">
        </el-table-column>
        <el-table-column
          prop="address"
          label="告警时间">
        </el-table-column>
        <el-table-column
          prop="type"
          label="告警类型">
        </el-table-column>
        <el-table-column
          prop="address"
          label="操作">
          <template slot-scope="scope">
            <el-button @click="handleClick(scope.row)" type="text" size="small">查看</el-button>
            <el-button type="text" size="small">删除</el-button>
          </template>
        </el-table-column>
      </el-table>
    </el-row>
  </div>
</template>

<script>
  export default {
    data() {
      return {
        dialog: false,
        data2: [{
          id: 1,
          label: '一级 1',
          children: [{
            id: 4,
            label: '二级 1-1',
            children: [{
              id: 9,
              label: '三级 1-1-1'
            }, {
              id: 10,
              label: '三级 1-1-2'
            }]
          }]
        }, {
          id: 2,
          label: '一级 2',
          children: [{
            id: 5,
            label: '二级 2-1'
          }, {
            id: 6,
            label: '二级 2-2'
          }]
        }, {
          id: 3,
          label: '一级 3',
          children: [{
            id: 7,
            label: '二级 3-1'
          }, {
            id: 8,
            label: '二级 3-2'
          }]
        }],
        defaultProps: {
          children: 'children',
          label: 'label'
        },
        tableData3: [{
          date: '192.168.1.150',
          name: '摄像头遮挡',
          type: "摄像头遮挡",
          address: '2018-4-5'
        }, {
          date: '192.168.1.150',
          name: '摄像头遮挡',
          type: "摄像头遮挡",
          address: '2018-4-5'
        },
          {
            date: '192.168.1.150',
            name: '摄像头遮挡',
            type: "摄像头遮挡",
            address: '2018-4-5'
          },
          {
            date: '192.168.1.150',
            name: '摄像头遮挡',
            type: "摄像头遮挡",
            address: '2018-4-5'
          }
        ]
      }
    },
    methods: {
      open() {
        this.dialog = true
      },
      close() {
        this.dialog = false
      },
      back_click(){
        this.$router.go(-1);
      }
    }
  }
</script>
<style>
  .time {
    font-size: 13px;
    color: #999;
  }

  .bottom {
    margin-top: 13px;
    line-height: 12px;
  }

  .button {
    padding: 0;
    float: right;
  }

  .image {
    width: 100%;
    padding-left: 70px;
    padding-right: 70px;
    padding-top: 20px;
    padding-bottom: 20px;
    display: block;
  }

  .clearfix:before,
  .clearfix:after {
    display: table;
    content: "";
  }

  .clearfix:after {
    clear: both
  }
</style>
